<template>
	<view class="content">
		<view class="content-top" >
			<view class="addres_">
				<view class="address-list">
					<view class="name-text">
						<view class="name-phone">
							邓世杰<view>13010086063</view>
							<view class="default">默认</view>
						</view>
						<view class="text_">广东省广州市天河区珠江新城龙安路24号越秀新世纪广场b栋写字楼1303</view>
					</view>
					<view class="image_">
						<image src="/static/home/icon/arrows.png"></image>
					</view>
				</view>
				<view class="do-default">
					设为默认
				</view>
			</view>
			
		</view>
		<view class="address-none" v-if="false">
			<image class="address-none-img" src="/static/home/address_blank.png" mode=""></image>
			<view class="adx">暂无地址设置</view>
			<viwe class="ads">没有收货地址寄不了快递哦~</viwe>
		</view>
		<view class="button-bottom">
			<!-- #ifdef MP-WEIXIN -->
			<button class="btn btn-square btn-b" @click="wechatAddress" hover-class="btn-hover2">从微信获取</button>
			<!-- #endif -->
			<button class="btn bottom-button" @click="toAdd()" hover-class="btn-hover2">新增收货地址</button>
		</view>
	</view>
</template>

<script>
import BaseUrl from '@/config/syapi.js';
export default {
    data() {
        return {
			list: [] ,// 用户收货地址列表
			type: ''
        }
    },
	onLoad (e) {
		// if(e.type){
		// 	this.type = e.type;
		// }
	},
	onShow(){
		this.userShipList();
	},
    methods: {
		// 双鱼
		userShipList(){
			uni.request({
				url:BaseUrl.addressList,
				header:{
					'Content-Type': 'application/x-www-form-urlencoded', //自定义请求头信息
					'token':this.$db.get('userToken')
				},
				data:{
					
				},
				success:res=>{
					if(res.statusCode==200){
						console.log('res.data.addresslist',res)
					}
				}
			})
		},
		// end
		// 获取收货地址列表
		// userShipList () {
		// 	this.$api.userShip({}, res => {
  //               if (res.status) {
  //                   this.list = res.data
  //               }
  //           })
		// },
		// // 收货地址删除
		// delShip (id) {
		// 	this.$common.modelShow('提示', '确认删除此收货地址?', () => {
		// 		let data = {
		// 			id: id
		// 		}
		// 		this.$api.removeShip(data, res => {
		// 			if (res.status) {
		// 				this.$common.successToShow(res.msg, () => {
		// 					this.userShipList();
		// 				});
		// 			} else {
		// 				this.$common.errorToShow(res.msg);
		// 			}
		// 		})
		// 	})
		// },
		// //编辑
		// toEdit (id) {
		// 	this.$common.navigateTo('./index?ship_id=' + id);
		// },
		// //添加
		toAdd() {
			this.$common.navigateTo('./index');
		},
		// //选择
		// isSelect(data) {
		// 	if(this.type == 'order'){
		// 		let pages = getCurrentPages();//当前页
		// 		let beforePage = pages[pages.length - 2];//上个页面
				
		// 		// #ifdef MP-ALIPAY || MP-TOUTIAO
		// 		this.$db.set('address_user_ship', data, true);
		// 		// #endif
		
		// 		// #ifdef H5 || APP-PLUS || APP-PLUS-NVUE
		// 		this.$store.commit("userShip",data)
		// 		// #endif

		// 		// #ifdef MP-WEIXIN
		// 		beforePage.$vm.userShip = data;
		// 		beforePage.$vm.params.area_id = data.area_id;
		// 		// #endif
				
		// 		uni.navigateBack({
		// 			delta: 1
		// 		});
		// 		// this.$common.navigateTo("/pages/goods/place-order/index")
		// 	}
		// },
		// // #ifdef MP-WEIXIN
		// wechatAddress: function () {
		// 	wx.chooseAddress({
		// 		success: res => {
		// 			if (res.errMsg == "chooseAddress:ok") {
		// 				//获取成功
		// 				//存储这个收获地区信息到数据库
		// 				let data = {
		// 					province_name: res.provinceName,
		// 					city_name: res.cityName,
		// 					county_name: res.countyName,
		// 					postal_code: res.postalCode
		// 				};
		// 				let areaId = 0;
		// 				this.$api.getAreaId(data, res1 => {
		// 					if (res1.status) {
		// 						//存储用户收货信息
		// 						let userShipId = 0;
		// 						let userShipData = {
		// 							area_id: res1.data,
		// 							user_name: res.userName,
		// 							detail_info: res.detailInfo,
		// 							tel_number: res.telNumber,
		// 							is_def: 2
		// 						}
		// 						this.$api.saveUserShipWx(userShipData, res2 => {
		// 							if (res2.status) {
		// 								this.$common.errorToShow('存储微信地址成功', r => {
		// 									setTimeout(rp => {
		// 										this.userShipList();
		// 									}, 1000);
		// 								});
		// 							}else{
		// 								uni.showModal({
		// 									title: '提示',
		// 									content: '存储微信地址失败',
		// 									showCancel: false
		// 								});
		// 							}
		// 						});
		// 					}else{
		// 						uni.showModal({
		// 							title: '提示',
		// 							content: '获取微信地址失败',
		// 							showCancel: false
		// 						});
		// 					}
		// 				});
		// 			} else {
		// 				uni.showModal({
		// 					title: '提示',
		// 					content: '获取微信地址失败',
		// 					showCancel: false
		// 				});
		// 			}
		// 		}
		// 	});
		// },
		// // #endif
    }
}
</script>

<style lang="less">
.content-top {
	padding-top:32rpx;
	.addres_ {
		margin:0 auto 22rpx;
		width:686rpx;
		border-radius:16rpx;
		padding-left:32rpx;
		padding-bottom:34rpx;
		background:rgba(255,255,255,1);
		.address-list {
			display:flex;
			justify-content: space-between;
			.image_ {
				margin:68rpx 24rpx 0 74rpx;
				width: 36rpx;
				height: 36rpx;
				image {
					width: 36rpx;
					height: 36rpx;
				}
			}
			.text_ {
				margin-top:8rpx;
				font-size:24rpx;
				font-family:PingFangSC-Regular,PingFang SC;
				font-weight:400;
				color:rgba(128,128,128,1);
			}
			.name-text {
				.name-phone {
					display:flex;
					font-size:28rpx;
					font-family:PingFangSC-Medium,PingFang SC;
					font-weight:500;
					color:rgba(51,51,51,1);
					margin:24rpx 0 0 0rpx;
					.default {
						margin-top:8rpx;
						margin-left:32rpx;
						width:68rpx;
						height:28rpx;
						line-height:28rpx;
						text-align:center;
						background:rgba(255,94,77,1);
						border-radius:40rpx;
						font-size:16rpx;
						font-weight:500;
						color:rgba(255,255,255,1);
					}
				}
			}
		}
		.do-default {
			color:rgba(255,255,255,1);
			font-size:28rpx;
			margin-top:24rpx;
			font-family:PingFangSC-Medium,PingFang SC;
			font-weight:500;
			background:rgba(255,94,77,1);
			width: 150rpx;
			height: 50rpx;
			line-height:50rpx;
			text-align:center;
			border-radius:16rpx;
		}
	}
	
	
}	
.button-bottom {
	width:686rpx;
	background:rgba(255,94,77,1);
	border-radius:34rpx;
	bottom:64rpx;
	left:32rpx;
	right:34rpx;
	color:white;
	button {
		border-radius:34rpx;
		color:white;	
		background:rgba(255,94,77,1);
	}
}
.cell-tip{
	background-color: #FF7159;
	color: #fff;
	font-size: 24upx;
	display: inline-block;
	float: left;
	padding: 4upx 10upx;
	margin-right: 10upx;
	transform: scale(.9);
}
.min-cell-group .cell-ft-text{
	font-size: 24upx;
	margin-right: 10upx;
}
.min-cell-group .cell-item-bd{
	color: #666;
	padding-right: 0;
}
.min-cell-group .default{
	color: #666;
}
.min-cell-group uni-radio .uni-radio-input{
	width: 36upx;
	height: 36upx;
}
.min-cell-group .default .checked-radio{
	display: inline-block;
	float: left;
	position: relative;
	bottom: 2upx;
}
.green{
	background-color: #999;
}
.cell-hd-title{
	font-size: 28upx;
}
.phone-num{
	margin-left: 20upx;
	color: #999;
	font-size: 24upx;
}
.address-none{
	text-align: center;
	padding: 200upx 0;
	.address-none-img{
		width: 400upx;
		height: 300upx;
	}
	.adx {
		font-size:28rpx;
		font-family:PingFangSC-Medium,PingFang SC;
		font-weight:500;
		color:rgba(51,51,51,1);
	}
	.ads {
		font-size:26rpx;
		font-family:PingFangSC-Regular,PingFang SC;
		font-weight:400;
		color:red;
		color:rgba(179,179,179,1);
	}
}
</style>